#!/usr/bin/python

import sqlite3

if __name__ == "__main__":
	
	db = sqlite3.connect('pappa-bot.test.db')
	c = db.cursor()
	
	print 'Drink...'
	c.execute('''SELECT drinkID, name, instructions, rating FROM drinks WHERE drinkID=34''')
	print str(c.fetchall())
	
	print 'Ingredients...'
	c.execute('''SELECT ingredientID, name FROM ingredients WHERE ingredientID IN (
		SELECT ingredientID FROM drink_ingredients WHERE drinkID=34);''')
	print str(c.fetchall())
	
	print 'Related ingredients...'
	c.execute('''SELECT name FROM ingredients WHERE ingredientID IN (
		SELECT relatedIngredientID FROM related_ingredients WHERE ingredientID IN (
		SELECT ingredientID FROM drink_ingredients WHERE drinkID=34));''')
	print str(c.fetchall())
	
	c.close()

